import Login from './views/Login.vue'
import NotFound from './views/404.vue'
import Home from './views/Home.vue'
import Main from './views/Main.vue'
import Banner from './views/banner/Banner.vue'
import Product from './views/product/product.vue'
import ProductForm from './views/product/product_form.vue'
import Category from './views/category/category.vue'
import User from './views/user/user.vue'
import Admin from './views/user/admin.vue'
import CategoryForm from './views/category/category_form.vue'
import Order from './views/order/order.vue'

let routes = [
    {
        path: '/login',
        component: Login,
        name: '',
        hidden: true
    },
    {
        path: '/404',
        component: NotFound,
        name: '',
        hidden: false
    },
    {
        path: '/',
        component: Home,
        name: '',
        iconCls: 'el-icon-s-fold',
        leaf: true,//只有一个节点
        children: [
            { path: '/main', component: Main, name: '首页' },
            { path: '/product/add', component: ProductForm, name: '新增产品' }
        ]
    },
    {
        path: '/',
        component: Home,
        name: '幻灯片管理',
        iconCls: 'el-icon-s-platform',//图标样式class
        children: [
            { path: '/banner', component: Banner, name: '首页幻灯片'},
        ]
    },
    {
        path: '/',
        component: Home,
        name: '产品管理',
        iconCls: 'el-icon-s-goods',
        children: [
            { path: '/product', component: Product, name: '产品列表' },
            { path: '/product/add', component: ProductForm, name: '新增产品' }
        ]
    },
    {
        path: '/',
        component: Home,
        name: '分类管理',
        iconCls: 'el-icon-s-fold',
        leaf: false,//只有一个节点
        children: [
            { path: '/category', component: Category, name: '分类列表' },
            { path: '/category/add', component: CategoryForm, name: '新增分类' }
        ]
    },
    {
        path: '/',
        component: Home,
        name: '订单管理',
        iconCls: 'el-icon-s-fold',
        leaf: true,//只有一个节点
        children: [
            { path: '/order', component: Order, name: '分类列表' },
        ]
    },
    {
        path: '/',
        component: Home,
        name: '用户管理',
        iconCls: 'el-icon-user-solid',
        leaf: false,//只有一个节点
        children: [
            { path: '/user', component: User, name: '网站用户' },
            { path: '/admin', component: Admin, name: '管理员' }
        ]
    },
    {
        path: '*',
        hidden: true,
        redirect: { path: '/404' }
    }
];

export default routes;
